package com.qf.j2112.service.impl;

import com.github.pagehelper.PageHelper;
import com.qf.j2112.mapper.SysLogMapper;
import com.qf.j2112.po.SysLog;
import com.qf.j2112.service.SysLogService;
import com.qf.j2112.utils.PageUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SysLogServiceImpl implements SysLogService {

    @Resource
    private SysLogMapper sysLogMapper;

    @Override
    public int addSysLog(SysLog sysLog) {
        return sysLogMapper.addSysLog(sysLog);
    }

    @Override
    public List<SysLog> findAllSysLog(PageUtil pageUtil) {
        PageHelper.startPage(pageUtil.getPage(),pageUtil.getPageSize());
        return sysLogMapper.findAllSysLog();
    }

    @Override
    public int countLog() {
        return sysLogMapper.countLog();
    }

    @Override
    public boolean delOneLog(int logId) {
       int i=sysLogMapper.delOneLog(logId);
       if(i>-1){
           return true;
       }
       return false;
    }
}
